(function() {
    function square(x) {
        return x * x;
    }
    //-------------------------------------------------------------------
    QUnit.test("common tasks test", function(assert) {
        assert.ok(1 == "1", "1 == '1'");
        assert.ok(1 === "1", "1 === '1'");
        assert.equal(square(2), '4', "square(2) equals '4'");
        assert.strictEqual(square(2), '4', "strict square(2) equals '4'");
    });
    QUnit.test("propEqual test", function(assert) {
        function Foo(x, y, z) {
            this.x = x;
            this.y = y;
            this.z = z;
        }
        Foo.prototype.doA = function() {};
        Foo.prototype.doB = function() {};
        Foo.prototype.bar = 'prototype';

        var foo = new Foo(1, "2", []);
        var bar = {
            x: 1,
            y: "2",
            z: []
        };
        assert.propEqual(foo, bar, "Strictly the same properties without comparing objects constructors.");
    });
    QUnit.test("deepEqual test", function(assert) {
        var obj = {
            foo: "bar",
            nums: [1, 2, 3, 4, 5],
            bool: true
        };

        assert.deepEqual(obj, {
            foo: "bar",
            nums: [1, 2, 3, 4, 5]
        }, "Two objects can be the same in value");
    });

    QUnit.test("multiple call done()", function(assert) {
        assert.expect(3);
        var done = assert.async(3);

        setTimeout(function() {
            assert.ok(true, "first call done.");
            done();
        }, 500);

        setTimeout(function() {
            assert.ok(true, "second call done.");
            done();
        }, 500);

        setTimeout(function() {
            assert.ok(true, "third call done.");
            done();
        }, 500);
    });
})();
